package cn.com.pajx.pajx_smart_platform.mvp.model;


import cn.com.pajx.pajx_smart_platform.api.HttpResponse;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
import okhttp3.ResponseBody;

/**
 * Created by ruancw on 2023/04/03.
 * model接口基类
 */

public interface IBaseModel {

    <T> Disposable getObservable(Observable<HttpResponse<T>> observable, String tag);

    Disposable getFileObservable(Observable<ResponseBody> observable, String tag);

    //网络请求接口回调
    interface IOnRequestListener {
        void onRequestSuccess(String data, String message, int code, String tag);

        void onDownloadSuccess(ResponseBody responseBody, String tag);

        void onRequestError(String message, int code, String tag);

        void onRequestFail(Throwable throwable);
    }
}
